package test13;

import java.util.function.Supplier;

/**
 * 一. Supplier接口使用
 给出测试类中代码如下：
 import java.util.function.Supplier;

 public class Test01 {
 public static <T> T getObj(Supplier<T> supplier) {
 return supplier.get();
 }

 public static void main(String[] args) {

 }
 }
 */
public class Test4 {
    public static void main(String[] args) {
        String rttt = getObj(new Supplier<String>() {
            @Override
            public String get() {
                String a = "dd";
                String b = "ff";
                return a + b;
            }
        });

        System.out.println(rttt);
    }

    public static <T> T getObj(Supplier<T> supplier) {
        return supplier.get();
    }
}
